package config

import "github.com/spf13/viper"

type RabbitMqConn struct {
	Addr 			string		//rabbit地址
	QueueName		string		//队列名称
	DelayQueueName	string		//延迟队列名称
	DelayTime		string		//延迟时间
	DelayNum		int			//延迟次数
}

func InitRabbitMqConn(cfg *viper.Viper) *RabbitMqConn {
	return &RabbitMqConn{
		Addr:           cfg.GetString("settings.rabbitMq.addr"),
		QueueName:      cfg.GetString("settings.rabbitMq.queueName"),
		DelayQueueName: cfg.GetString("settings.rabbitMq.delayQueueName"),
		DelayTime:      cfg.GetString("settings.rabbitMq.delayTime"),
		DelayNum:       cfg.GetInt("settings.rabbitMq.delayNum"),
	}
}


var RabbitMqConf = new(RabbitMqConn)